package com.world.rickcloudendpoint.common.constant;

public enum DetailErrorCodes {


    /********************************************************************/
    /***************************基本错误**********************************/

    /**
     * 未知错误
     */
    Unknown_Error(0, "Unknown error"),

    /**
     * 数据库连接错误
     */
    Database_Connect_Fail(1, "database connect fail"),

    /**
     * 数据库操作错误
     */
    Database_Opertate_Fail(2, "database operate fail"),

    /**
     * 配置文件不存在
     */
    Configuration_Not_Existed(7, "Configuration is not existed"),

    /**
     * 配置文件错误
     */
    Configuration_IS_BAD(8, "Configuration is bad"),


    /********************************************************************/
    /***************************业务错误**********************************/

    /**
     * 未认证
     */
    No_Authentication(101, "no authentication , please authentication first"),

    /**
     * 认证失败
     */
    Authentication_Fail(102, "authentication fail"),

    /**
     * 未授权
     */
    No_Authorization(103, "no authentication"),

    /**
     * 实体属性重名
     */
    Entity_Attribute_Duplication(104, "entity attribute is duplicated"),

    /**
     * 实体属性非法，超长，为空等等情况
     */
    Entity_Attribute_Illegal(105, "entity attribute is illegal"),

    /**
     * 实体属性非法，超长，为空等等情况
     */
    Entity_Not_Existed(106, "entity is not existed"),

    /**
     * 请求参数为空
     */
    Request_Param_Null(107, "request param is null"),

    /**
     * 请求参数
     */
    Request_Param_Illegal(108, "request param is illegal"),
    /**
     * 空值
     */
    Object_Is_Null(109, "object is null"),
    /**
     * 文件读写失败
     */
    File_Parser_Error(303, "Model file read or write error."),
    File_Upload_Failed(304, "File upload error or move to local error"),

    /**
     * netty网络通信
     */
    Net_Protocol_Not_Supported(800, "Net Protocal Not Supported"),


    ;


    private final int value;

    private final String reasonPhrase;

    DetailErrorCodes(int value, String reasonPhrase) {
        this.value = value;
        this.reasonPhrase = reasonPhrase;
    }

    /**
     * Return the integer value of this status code.
     */
    public int value() {
        return this.value;
    }

    /**
     * Return the reason phrase of this status code.
     */
    public String getReasonPhrase() {
        return this.reasonPhrase;
    }

}
